<script setup lang="ts">
import type { CategoryItem } from '@/types/home';
// 定义 props 接收数据
defineProps<{
  list: CategoryItem[]
}>()
</script>
<template>
  <view class="category">
    <navigator class="category-item" url="/pages/index/index" v-for="item in list" :key="item.id" hover-class="none">
      <image class="icon" :src="item.icon">
      </image>
      <text class="text">{{ item.name }}</text>
    </navigator>
  </view>
</template>
<style lang="scss" scoped>
@import '../styles/category.scss';
</style>